//
//  LPTDiagnosisTableViewCell.m
//  LPTClient
//
//  Created by mac on 2018/12/8.
//  Copyright © 2018年 zhaodd. All rights reserved.
//

#import "LPTDiagnosisTableViewCell.h"

@interface LPTDiagnosisTableViewCell ()<UITextViewDelegate>

@end

@implementation LPTDiagnosisTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.textView.delegate = self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(void)textViewDidBeginEditing:(UITextView *)textView
{
    
}

-(void)textViewDidChange:(UITextView *)textView
{
    if (textView.text.length > 0) {
        self.placeHolder.hidden = YES;
    }else{
        self.placeHolder.hidden = NO;
    }
}

-(BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text
{
    NSString *string = [textView.text stringByReplacingCharactersInRange:range withString:text];
    
    if (string.length > 100) {
        return NO;
    }
    
    return YES;
}

@end
